package com.todo.biz.application.handler.review.content;


import com.todo.biz.application.entity.enums.ContentReviewEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2024/6/12 14:22
 * @description
 */
@Component
public class ReviewHandleFactory {

    @Autowired
    private List<AbstractContentReview> contentReviewList;

    public AbstractContentReview getContentReview(ContentReviewEnum contentReviewEnum) {
        if (CollectionUtils.isEmpty(contentReviewList)) {
            return null;
        }
        for (AbstractContentReview contentReview : contentReviewList) {
            if (contentReview.getContentReviewEnum().equals(contentReviewEnum)) {
                return contentReview;
            }
        }
        return null;
    }


}
